package two_shape;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;

/**
 * 圆角矩形
 */
public class CornerRectangle extends Application {
    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Rectangle Example");
        Group group = new Group();
        Rectangle rectangle = new Rectangle();
        rectangle.setX(20);
        rectangle.setY(20);
        rectangle.setWidth(100);
        rectangle.setHeight(100);
        rectangle.setArcHeight(20);
        rectangle.setArcWidth(20);
        rectangle.setFill(Color.RED);
        group.getChildren().addAll(rectangle);
        Scene scene = new Scene(group, 200, 300, Color.GRAY);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
